<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>四级项目1.3</title>
</head>
<body>
<script>
    var arr = [7, 9, 6, 2, 5, 1, 0, 3, 8, 4];
    console.log(arr)
    for (var i = 1; i < arr.length - 1; i++) {
      for (var j = 0; j < arr.length - i; j++) {
        if (arr[j] > arr[j + 1]) {
          var temp = arr[j + 1];
          arr[j+1] = arr[j];
          arr[j] = temp;
        }
      }

  }
    console.log(arr);
</script>
</body>
</html>
